<?php

class Application_Model_role extends Zend_Db_Table_Abstract {
	
		protected $_name = 'role';
		
		public function fetchAlldata()
		{
			$select = $this->select();
			$select->from($this);
			return $this->fetchAll($select);
		}
		
		public function fetchbyId($id)
		{
			$select = $this->select();
			$select ->setIntegrityCheck(false)
					->from($this)
				    ->where('role_id = ?', $id);
			$role = $this->fetchRow($select);
			return $role;
		}
		
		public function fetchbyrole($role)
		{
			$select = $this->select();
			$select ->setIntegrityCheck(false)
					->from($this)
				    ->where('role_libelle = ?', $role);
			$role = $this->fetchRow($select);
			return $role;
		}

}
?>